<style type="text/css">
    h1 {color: #777;}
    #party_summary p {
        margin: 0px;
    }
    #party_summary {
        padding: 10px;
    }
    #vcard {
        float: left;
        margin-right: 20px;
    }
    #basic_id {
        float: left;
        width: 40%;

    }
    #extended_summary {
        float: left;
        margin-top: 25px;
        padding: 0px 10px 20px 20px;
        width: 40%;
        background-color: #ddd;
        border-radius: 10px;

    }
    #extended_summary h2 {
        color: black;
        font-size: 14px;
    }
</style>

<div id="party_summary">

  <div id="vcard">
    <%= image_tag("/assets/erp_app/organizer/applications/crm/vcard.png") %>
  </div>

  <div id="basic_id">
    <% if @party.business_party_type == 'Individual' %>
        <h1><%= @party.business_party.current_first_name %> <%= @party.business_party.current_middle_name %> <%= @party.business_party.current_last_name %> <%= @party.business_party.current_suffix %></h1>
        <p>Nickname: <%= @party.business_party.current_nickname %></p>
        <p><%= @party.business_party.current_personal_title || '' %></p>
        <p>Enterprise ID: <%= @party.enterprise_identifier %></p>


    <% else %>
        <h1> <%= @party.description %></h1>
        Enterprise ID: <%= @party.enterprise_identifier %>
        <br>
        Tax ID: <%= @party.business_party.tax_id_number %>
        <br>
    <% end %>

	<% if @party.primary_phone %>
		Primary Phone: <%= @party.primary_phone.to_s  %>
		<br>
	<% end %>
	
	<% if @party.primary_email %>
		Primary Email: <%= @party.primary_email.to_s %>
		<br>
	<% end %>
	
	<% if @party.primary_address %>
		Primary Address: <%= @party.primary_address.to_s  %>
	<% end %>

  </div>

   <% if @party.user %>

     <div id="extended_summary">

       <h2>User Information</h2>
       Username: <%= @party.user.username %>
       <br>
       Email: <%= @party.user.email %>
       <br>
       Last Login: <%= @party.user.last_login_at.nil? ? 'N/A' : @party.user.last_login_at.to_s %>
       <br>
       Status: <%= @party.user.activation_state.nil? ? 'Pending' : @party.user.activation_state.capitalize %>

     </div>

   <% end %>


</div>
